﻿using System;
namespace Kis.Xroad.Eu {
    
    
    [System.SerializableAttribute()]
    public class RestrictedSimpleContent : global::Kis.Xroad.Eu.FamilyMountainBikeSizes {
        
        public const string SMALL = "small";
        
        public const string MEDIUM = "medium";
        
        public RestrictedSimpleContent(string value) : 
                base(value) {
            this.Validate();
            string annot = null;
            if (Value == "small") {
                annot = "small";
            }
            if (Value == "medium") {
                annot = "medium";
            }
            if (annot!=null) {
                this._annotation = annot;
            }
            else {
                throw new global::Xtee.Core.Types.XteeSimpleTypeValidationException(string.Format("Enumeration on [{0}] does not allow value : [{1}] ", this.GetType().Name,Value.ToString()));;
            }
        }
        
        public RestrictedSimpleContent() : 
                base(string.Empty) {
        }
        
        public static bool TryParse(string value, out global::Kis.Xroad.Eu.RestrictedSimpleContent result) {
            try {
                result = new global::Kis.Xroad.Eu.RestrictedSimpleContent(value);
                return true;
            }
            catch (System.Exception ) {
                result = null;
                return false;
            }
        }
        
        public static implicit operator String (RestrictedSimpleContent value) {
            return value.Value;
        }
        
        public static implicit operator RestrictedSimpleContent (string value) {
            if (value==null) {
                return null;
            }
            return new RestrictedSimpleContent(value);
        }
    }
}
